<div class='toolbar'>
  <ul class='actions'>
    <li>
      <p><%= button_link_to t("new_plan"), new_admin_pricing_plan_path, :icon => 'add', :id => 'admin_new_pricing_plan_link' %></p>
    </li>
  </ul>
  <br class='clear' />
</div>

<h1><%= t("listing_plans") %></h1>

<table class="index" id='listing_plans'>

  <thead>
  <tr>
    <%= hook :admin_plans_index_headers do %>
      <th><%= sort_link @search,:plan_name,t("plan") %></th>
      <th><%= sort_link @search,:amount,t("amount") %></th>
      <th><%= sort_link @search,:transaction_fee,t("transaction_fee") %></th>
      <th><%= sort_link @search,:no_of_products,t("no_of_products") %></th>
      <th><%= t("payment_period") %></th>
      <th><%= t("payment_status") %></th>
      <th>
        <%= hook :admin_plans_index_header_actions %>
      </th>
    <% end %>
  </tr>
  </thead>
  <tbody>
<% @pricing_plans.each do |pricing_plan| %>
   <%- locals = {:pricing_plan => pricing_plan} %>

  <tr id="pricing_plan_<%=pricing_plan.id%>">
    <td class='user_email'><%=link_to pricing_plan.plan_name, admin_pricing_plan_path(pricing_plan) %></td>
    <td><%= number_to_currency pricing_plan.amount %></td>
    <td><%= pricing_plan.transaction_fee %> %</td>
    <td><%= pricing_plan.no_of_products %></td>
    <td><%= pricing_plan.payment_period %></td>
    <td><%= (pricing_plan.is_active?) ? "Active" : "Inactive" %></td>

		<td>
     <%= hook :admin_pricing_plans_index_row_actions, locals do %>
        <%= link_to_edit pricing_plan, :class => "edit" %> &nbsp;
		<%end%>
		</td>
		
  </tr>
<% end %>

</tbody>
</table>
<%= will_paginate(@pricing_plans, :previous_label => "&#171; #{t('previous')}", :next_label => "#{t('next')} &#187;") %>

<% content_for :sidebar do %>
  <div class="box">
    <h3><%= t(:search) %></h3>
    <% @search = PricingPlan.search %>
    <%= form_for [:admin, @search] do |f| %>
      <%- locals = {:f => f} %>
      <%= hook :admin_pricing_plan_index_search, locals do %>
        <p>
          <%= t("plan") %><br />
          <%= f.text_field :plan_name_contains, :size=>18 %>
        </p>
      <% end %>
      <%= hook :admin_pricing_plan_index_search_buttons, locals do %>
        <p><%= button t("search") %></p>
      <% end %>
    <% end %>
  </div>
<% end %>
